{extend name="public:common_index"/}
{block name="main"}
    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-title"><i class="fa fa-list"></i> {$title}</h3>
        </div>
        <div class="panel-body">
            <div class="navbar navbar-default">
                <form action="" id="search-form2" class="navbar-form form-inline" method="get" onsubmit="return false">
                    <div class="form-group">
                        <label class="control-label" for="input-order-id">昵称</label>
                        <div class="input-group">
                            <input type="text" name="nick_name" value="{:trim(input('nick_name'))}" placeholder="昵称"
                                   id="input-order-id" class="form-control">
                        </div>

                        <div class="input-group">
                            <input type="text" name="market" value="{:trim(input('market'))}" placeholder="下载市场"
                                   class="form-control">
                        </div>

                        <div class="input-group">
                            <input type="text" name="content" value="{:trim(input('content'))}" placeholder="内容" class="form-control">
                        </div>
                        <label class="control-label" for="input-order-id">性别</label>
                        <select class="form-control" name="sex">
                            <option id="sex" value="">全部</option>
                            <option id="sex1" value="1">男</option>
                            <option id="sex2" value="2">女</option>
                        </select>


                        <label class="control-label" for="input-order-id">付费状态</label>
                        <select class="form-control" name="is_pay">
                            <option id="is_pay" value="">全部</option>
                            <option id="is_pay1" value="1">已付费</option>
                            <option id="is_pay0" value="0">未付费</option>
                        </select>


                        <div class="form-group">
                            <label class="control-label" for="input-order-id">反馈时间</label>
                            <div class="input-group">
                                <input type="text"   name="startDate"  autocomplete="off" value="{$Think.get.startDate}" placeholder="选择开始时间"
                                       class="form-control timepicker">
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="input-group">
                                <input type="text"   name="endDate"  autocomplete="off" value="{$Think.get.endDate}" placeholder="选择结束时间"
                                       class="form-control timepicker">
                            </div>
                        </div>
                        <button type="submit" onclick="javascript:document.getElementById('search-form2').submit();"
                                id="button-filter search-order" class="btn btn-primary"><i class="fa fa-search"></i> 筛选
                        </button>
                    </div>

                    <!--<a href="{:Url('edit')}" class="btn btn-primary pull-right"><i class="fa fa-plus"></i>添加</a>-->
                    <!--<a href="{:url('examiner_batch')}" class="btn btn-primary pull-right"><i class="fa fa-folder-open-o"></i>批量导入</a>-->
                </form>
            </div>
            <div id="ajax_return">
                <form method="post" enctype="multipart/form-data" target="_blank" id="form-order">
                    <div class="table-responsive">
                        <table class="table table-bordered table-hover">
                            <thead>
                            <tr>
                                <td>序号</td>
                                <td>用户ID</td>
                                <td>用户昵称</td>
                                <td>手机号码</td>
                                <td>付费状态</td>
                                <td>性别</td>
                                <td>年龄</td>
                                <td>手机型号</td>
                                <td>下载市场</td>
                                <td>内容摘要</td>
                                <td>类型</td>
                                <td>反馈时间</td>
                            </tr>
                            </thead>
                            <tbody>
                            <!-- 列表循环开始 -->
                            {volist name="rows" id="row" key="key"}
                            <tr>
                                <td>{$key}</td>
                                <td><a href="{:url('user/index')}?user_id={$row.user_id}">{$row.user_id}</a></td>
                                <td class="emojstext">{$row.nick_name}</td>
                                <td class="emojstext">{$row.phone}</td>
                                <td>
                                    {if $row.sex == 1}
                                    {if $row.is_pay == 1} 已付费{else /}  {/if}
                                    {/if}
                                </td>
                                <td class="emojstext">{if $row.sex == 1} 男{else /} 女 {/if}</td>
                                <td>{:getAge($row.birthday)}</td>
                                <td>{$row.phone_type}</td>
                                <td>{$row.market}</td>
                                <td class="emojstext">{$row.content|sub_str=60}</a></td>
                                <td>{if condition="$row.type == 1"} 意见反馈 {else /} 小调查 {/if}</a></td>
                                <td>{$row.create_time}</td>

                            </tr>
                            {/volist}
                            <!-- 列表循环结束 -->
                            </tbody>
                        </table>
                    </div>
                </form>
            </div>
            <div id='pagerarea'>{$pageHTML}</div>
        </div>
    </div>
{/block}

{block name="js"}
<script>
    $(function () {

        $.each($('.emojstext'),function (k,v) {
            var $text = $(v);
            var html = $text.html().trim().replace(/\n/g, '<br/>');
            html = jEmoji.softbankToUnified(html);
            html = jEmoji.googleToUnified(html);
            html = jEmoji.docomoToUnified(html);
            html = jEmoji.kddiToUnified(html);
            $text.html(jEmoji.unifiedToHTML(html));
        });

        var status   = "{$row.status}";
        if(status){
            $('#status'+status).attr('selected',true)
        }
        var is_read = "{$Think.get.is_read}";
        $('#is_read'+is_read).attr('selected','selected');

        var sex = "{$Think.get.sex}";
        $('#sex'+sex).attr('selected','selected');


        var type = "{$Think.get.type}";
        $('#type'+type).attr('selected','selected')
    })

</script>



{/block}



